<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			/*var name = "abc";
			var init = (function(){
				var name = 'init';
				function callName(){
					console.log(name);
				}
				return function(){
					callName();
				}
			}());
			
			
			var initDeng = (function(){
				var name = 123;
				function callName(){
					console.log(name);
				}
				return function(){
					callName();
				}
			}());
			
			initDeng();
			init();*/
			
			/*//连续调用
			var deng = {
				smoke : function(){
					console.log("Smoking...,炫酷");
					return this;
				},
				drink : function(){
					console.log('drinking ..ye cool');
					return this;
				},
				perm : function(){
					console.log('preming...,cool');
					return this;
				}
			}
			deng.smoke().drink().perm();*/
			
/*			var deng = {
				wife1 : {name : "xiaoliu"},
				wife2 : {name : "xiaozhang"},
				wife3 : {name : "xiaomeng"},
				wife4 : {name : "xiaowang"},
				sayWife : function(num){
					return this['wife' + num];
				}
			}*/
			
//枚举
			
			/*var arr = [1,2,3,4,,5,6,7,8,9];
			//遍历，枚举/enumeration
			for (var i = 0; i < arr.length; i++) {
				console.log(arr[i]);
			}*/
			
			/*var obj = {
				name : '123',
				age : 123,
				sex : 'male',
				height : 180,
				weight : 75
			}
			for(var prop in obj){
//				console.log(prop + " " + typeof(prop));
				console.log(prop + " " + obj[prop]);
			}*/
			
			/*Object.prototype.name = "abc";
			var obj = {
				name : '123',
				age : 123,
				sex : 'male',
				height : 180,
				weight : 75,
				__proto__ : {
					lastName : "deng"
				}
			}
			for(var prop in obj){
				if(!obj.hasOwnProperty(prop)){
					console.log(prop + " " + obj[prop]);
				}
			}*/
			
			//in判断能否访问这个属性
			
//instanceof
//看A对象的原型链上有么有B的原型
			/*function Person(){
			}
			var person = new Person();
			console.log(person instanceof Person);//true
			console.log(person instanceof Object);//true*/
			
//判断一个对象是数组还是对象    
//1. obj instanceof Array
//2. Object.prototype.toString.call(obj);
//3. obj.constrcutor

						
			
			
		</script>
	</body>
</html>
